package com.meisiabc.utils;

import org.apache.commons.lang3.StringUtils;

public abstract class MobileUtils {
    public static boolean isValidMobile(String mobile) {
        if (StringUtils.isBlank(mobile)) {
            return false;
        }

        if (!mobile.startsWith("1")) {
            return false;
        }

        if (mobile.length() != 11) {
            return false;
        }

        return true;
    }

    public static boolean isValidSmsCode(String smsCode) {
        if (StringUtils.isBlank(smsCode)) {
            return false;
        }

        if (smsCode.length() != 6) {
            return false;
        }

        if (!StringUtils.isNumeric(smsCode)) {
            return false;
        }

        return true;
    }
}
